package secretaryGUI;


import java.awt.Color;


import java.awt.Color;


import java.sql.SQLException;

import javax.swing.JLabel;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.JTableHeader;
import javax.swing.table.TableColumn;
import javax.swing.table.TableColumnModel;

import com.sun.rowset.CachedRowSetImpl;

import flexibility.CachedRowSetTableModel;
import guiCode.secretaryScreenCode;

public class updateLowerTableEntries {

	secretaryAlerts sa = new secretaryAlerts();
	private CachedRowSetTableModel data;
	private secretaryScreenCode ssc;
	
	public void update(createSecretaryWindow csw, CachedRowSetImpl crs) {
		
		try {
			csw.table_1.setModel(data = new CachedRowSetTableModel(crs));
			DefaultTableCellRenderer centerRenderer = new DefaultTableCellRenderer();
			centerRenderer.setHorizontalAlignment(JLabel.CENTER);
			for (int i = 0; i < csw.table_1.getColumnCount(); i++)
				csw.table_1.getColumnModel().getColumn(i)
						.setCellRenderer(centerRenderer);
			//csw.table_1.setEnabled(false);
			JTableHeader header = csw.table_1.getTableHeader();
			 
			
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
}
